package com.usion.login.controller;

import com.usian.common.ResultVo;
import com.usion.login.pojo.User;
import com.usion.login.service.Logservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("api/user")
public class Login {
    @Autowired
private Logservice logservice;
    @RequestMapping("/login")
    public ResultVo login(String mobile){

        return logservice.code(mobile);

    }
    @RequestMapping("/denlu")
    public ResultVo denglu(String mobile,String code){
        return logservice.denlu(mobile,code);
    }
    @RequestMapping("/add")
    public ResultVo add(@RequestBody User user){
        logservice.add(user);
        return new ResultVo();
    }
}
